package com.olympus.hermes.product.bean.dto.brand;

import com.olympus.hermes.common.bean.AbstractBeanConvert;
import com.olympus.hermes.product.domain.Brand;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.Instant;

/**
 * @author Mickey
 * @since 2021/1/20
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class OutputBrandDTO extends AbstractBeanConvert<OutputBrandDTO, Brand> {

    private Long id;

    private String name;

    private Instant createdAt;

    @Override
    protected Brand doForward(OutputBrandDTO outputBrandDTO) {
        return null;
    }

    @Override
    protected OutputBrandDTO doBackward(Brand brand) {
        this.setId(brand.getId());
        this.setCreatedAt(brand.getCreatedAt());
        this.setName(brand.getName());
        return this;
    }
}
